import { createRouter, createWebHistory } from "vue-router";
import Layout from "@/layout/index.vue";
const routes = [
	{
		path: "/",
		redirect: "/login",
	},
	{
		path: "/login",
		component: () => import("@/views/Login.vue"),
		meta: { title: "登录" },
		hidden: true,
	},
	{
		path: "/home",
		component: () => import("@/layout/index.vue"),
		meta: { title: "主页" },
		hidden: true,
		children: [
			{
				path: "/dashboard",
				component: () => import("@/views/Dashboard.vue"),
				name: "dashboard",
				meta: { title: "仪表盘", isHome: true },
				children: [
				],
			},
			{
				path: "/ZhuangXiangLiuZhuan",
				name: "ZhuangXiangLiuZhuan",
				meta: {
					title: "专项流转",
					roles: ["技术管理", "工班长"],
				},
				children: [
					{
						path: "/ZhuangXiang",
						component: () => import("@/views/ZhuangXiangLiuZhuan/ZhuangXiang.vue"),
						name: "ZhuangXiang",
						meta: {
							title: "专项列表",
						},
					},
				],
			},
			{
				path: "/ChaXianHeTu",
				name: "ChaXianHeTu",
				meta: { title: "查线核图" },
				children: [
					{
						path: "/MuBanGuanLi",
						component: () => import("@/views/ChaXianHeTu/MuBan.vue"),
						name: "MuBanGuanLi",
						meta: { title: "模板管理" },
					},
				],
			},
			{
				path: "/HeTongGuanLi",
				name: "HeTongGuanLi",
				meta: { title: "合同管理" },
				children: [
					{
						path: "/DianLiangShuJu",
						component: () => import("@/views/HeTongGuanLi/DianLiangShuJu.vue"),
						name: "DianLiangShuJu",
						meta: { title: "电量数据" },
					},
					{
						path: "/MeiYueDianJia",
						component: () => import("@/views/HeTongGuanLi/MeiYueDianJia.vue"),
						name: "MeiYueDianJia",
						meta: { title: "每月电价" },
					},
					{
						path: "/JieSuanDianLiang",
						component: () => import("@/views/HeTongGuanLi/JieSuanDianLiang.vue"),
						name: "JieSuanDianLiang",
						meta: { title: "结算电量" },
					},
					{
						path: "/QingDanShengCheng",
						component: () => import("@/views/HeTongGuanLi/QingDanShengCheng.vue"),
						name: "QingDanShengCheng",
						meta: { title: "清单生成" },
					},
					{
						path: "/DianBiaoGuanLi",
						component: () => import("@/views/HeTongGuanLi/DianBiaoGuanLi.vue"),
						name: "DianBiaoGuanLi",
						meta: { title: "电表管理" },
					},
					{
						path: "/BiaoJiGuanLi",
						component: () => import("@/views/HeTongGuanLi/BiaoJiGuanLi.vue"),
						name: "BiaoJiGuanLi",
						meta: { title: "表计管理" },
					},
				],
			},
			{
				path: "/ShuJuGuanLi",
				name: "ShuJuGuanLi",
				meta: { title: "数据管理" },
				children: [
					{
						path: "/ZiDian",
						component: () => import("@/views/ShuJuGuanLi/ZiDian.vue"),
						name: "ZiDian",
						meta: { title: "数据字典" },
					},
					{
						path: "/UserManage",
						component: () => import("@/views/ShuJuGuanLi/UserManage.vue"),
						name: "UserManage",
						meta: { title: "用户管理" },
					},
					{
						path: "/RoleManage",
						component: () => import("@/views/ShuJuGuanLi/RoleManage.vue"),
						name: "RoleManage",
						meta: { title: "角色管理" },
					},
				],
			},
		],
	},
];
const router = createRouter({
	history: createWebHistory(),
	routes,
});
export default router;
